package com.sunday.fangdaifu.common;

import android.content.Context;
import android.os.Environment;


import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Properties;

/**
 * Created by 刘涛 on 2017/5/19.
 */

public class AppConfig {
    private final static String APP_CONFIG = "config";
    public static final String KEY_LOAD_IMAGE = "KEY_LOAD_IMAGE";
    public static final String KEY_NOTIFICATION_DISABLE_WHEN_EXIT = "KEY_NOTIFICATION_DISABLE_WHEN_EXIT";
    public static final String KEY_CHECK_UPDATE = "KEY_CHECK_UPDATE";
    public static final String KEY_DOUBLE_CLICK_EXIT = "KEY_DOUBLE_CLICK_EXIT";

    // 默认存放图片的路径
    public final static String DEFAULT_SAVE_IMAGE_PATH = Environment
            .getExternalStorageDirectory()
            + File.separator
            + "房大夫"
            + File.separator + "房大夫" + File.separator;

    // 默认存放文件下载的路径
    public final static String DEFAULT_SAVE_FILE_PATH = Environment
            .getExternalStorageDirectory()
            + File.separator
            + "房大夫"
            + File.separator + "download" + File.separator;

    // 默认录音文件下路径
    public final static String DEFAULT_RECORD_SAVE_FILE_PATH = Environment
            .getExternalStorageDirectory()
            + File.separator
            + "房大夫"
            + File.separator +"报告草稿" + File.separator+ "record" + File.separator;

    // 默认草稿文件下路径
    public final static String DEFAULT_REPORT_SAVE_FILE_PATH = Environment
            .getExternalStorageDirectory()
            + File.separator
            + "房大夫"
            + File.separator + "报告草稿" + File.separator;


    private Context mContext;
    private static AppConfig appConfig;

    public static AppConfig getAppConfig(Context context) {
        if (appConfig == null) {
            appConfig = new AppConfig();
            appConfig.mContext = context;
        }
        return appConfig;
    }

    public static String getMP3FileNameForDate() {
        Date date = new Date();
        SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmssSSS");
        String fileName = format.format(date) + ".mp3";
        return fileName;
    }


    //R.string.releaseUrl
    //BuildConfig.API_SERVER_URL

    //BuildConfig.API_SERVER_URL
}

